<%#include "todoList.h" %>
<%
QString lang = httpRequest().cookie("lang");
QVariantMap qMap = httpRequest().queryItems();
QString tid = tId();

QString action = qMap.contains("action") ? httpRequest().queryItemValue("action"): variant("action").toString();
QString todoListId = qMap.contains("todoListId") ? httpRequest().queryItemValue("todoListId"): variant("todoListId").toString();
TodoList todoList = TodoList::get(hmacVal(todoListId).toInt());

QVariantMap qMapOut;
qMapOut.insert("todoListId",todoListId);
qMapOut.insert("action",action);
%>
<% if (action == "show"){ %>
<!-- show -->
<div id="formTodoList<%== tid %>" name="formTodoList" class="form" >
  <table class="layout-fixed" width="100%">
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TODOLISTCD") %>:</td>
      <td><span style="padding-right:30px;" ><%== todoList.todoListCd() %></span>
      <td style="text-align:right;white-space:nowrap"><%== UI("TODOLISTNAMEZH") %>:</td>
      <td><span style="padding-right:30px;" ><%== todoList.todoListNameZh() %></span>
      <td style="text-align:right;white-space:nowrap"><%== UI("TODOLISTNAMEEN") %>:</td>
      <td><span style="padding-right:30px;" ><%== todoList.todoListNameEn() %></span>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TODOLISTTOOLTIP") %>:</td>
      <td colspan="5"><span style="padding-right:15px;"><%== todoList.todoListTooltip() %></span></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TODOLISTDESC") %>:</td>
      <td colspan="5"><span style="padding-right:15px;"><%== todoList.todoListDesc() %></span></td>
   </tr>
  </table>
</div>
<% }else { %>
<!-- edit -->
<div id="formTodoList<%== tid %>" name="formTodoList" class="form" action="/SystemUIsetting/<%== action %>TodoList">
  <%== inputAuthenticityTag() %>
  <% if (action != "create") { %>
     <input name="todoListId" class="mini-textbox" visible="false" value="<%== todoListId %>"  /> 
  <% } %>
  <table style="width:100%">
   <tr>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("TODOLISTCD") %></b>:</td>
      <td><input name="todoListCd" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== todoList.todoListCd() %>" /></td>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("TODOLISTNAMEZH") %></b>:</td>
      <td><input name="todoListNameZh" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== todoList.todoListNameZh() %>" /></td>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("TODOLISTNAMEEN") %></b>:</td>
      <td><input name="todoListNameEn" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== todoList.todoListNameEn() %>" /></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TODOLISTTOOLTIP") %>:</td>
      <td colspan="5"><input name="todoListTooltip" class="mini-textarea" vtype="maxLength:256" style="width:100%" value="<%== todoList.todoListTooltip() %>" /></td>
    </tr>
    <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("TODOLISTDESC") %>:</td>
      <td colspan="5"><input name="todoListDesc" class="mini-textarea" style="width:100%" value="<%== todoList.todoListDesc() %>" /></td>
    </tr>
  </table>
</div>
<% } %>
<!-- toolBar -->
<div class="mini-toolbar" style="border:0px">
    <% if (action == "show" && accessAllow("SystemUIsetting","editTodoList")){ %>
        <a class="mini-button" onclick="editForm('formTodoList<%== tid %>','/PartialService/formTodoList?action=edit&todoListId=<%== todoListId%>')" tooltip="<%== UI("TP_SYSTEMUISETTING_EDIT_TODOLIST") %>" ><%== UI("Edit") %></a>
    <% } %>
</div>
<!-- tabs -->
<div class="mini-fit">
    <% if (action != "create") { %>
    <%== renderPartial("SystemUIsetting/relationOfTodoList",qMapOut) %> 
    <% } %>
</div>